<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('入职信息登记表新增及修改')" />
	<th:block th:include="include :: businessCSS" />
	<style type="text/css">
	.addMore{line-height: initial;position: absolute;margin-top: -7px;top: 13px;right: 8px;}
	.layui-table[lay-size="sm"] tr td{text-align: center;}
	.date-box{width:47%;height:20px;}
	.date-box{text-align:center}
	</style>
</head>
<body class="no-skin">
<div class="main-container" id="main-container">
	<div class="main-content">
	<form class="layui-form head-form">
	    <div class="north">
            <th:block th:include="include :: business_btn" />
	        <th:block th:include="include :: business_tpl('top')" />
			<!-- 静态表格 -->
		    <div style="margin:10px">
			  	<table class="layui-table" lay-size="sm">
			    <colgroup>
<!-- 			      <col width="10%"> -->
<!-- 			      <col width="15%"> -->
<!-- 			      <col width="10%"> -->
<!-- 			      <col width="15%"> -->
<!-- 			      <col width="10%"> -->
<!-- 			      <col width="15%"> -->
<!-- 			      <col width="10%"> -->
<!-- 			      <col width="15%"> -->
			    </colgroup>
				<thead>
			      <tr>
			        <th colspan="7">基础信息</th>
			      </tr> 
			    </thead>
			    <tbody>
		    	  <!-- <tr>
			        <td class="table-title">岗位</td>
		    	  	<td th:if="${!gridColumns.readOnly}">
			        	<input type="text" id="vGw" name="vGw" autocomplete="off" class="layui-input" lay-verify="required"/>
			        	<i class="layui-icon layui-icon-more getMore" style="position:absolute" onclick="getMore('vGw',null,'岗位','ts_roleinfo');"></i>
		        	</td>
		        	<td th:if="${gridColumns?.readOnly}">
			        	<input type="text" id="vGw" name="vGw" class="layui-input" lay-verify="required" readonly/>
		        	</td>
			        <td class="table-title">所属办公室</td>
		        	<td th:if="${!gridColumns.readOnly}">
			        	<input type="text" id="vBgs" name="vBgs" autocomplete="off" class="layui-input" lay-verify="required"/>
			        	<i class="layui-icon layui-icon-more getMore" style="position:absolute" onclick="getMore('vBgs',null,'办公室','tb_baseinfo_bgs');"></i>
		        	</td>
		        	<td th:if="${gridColumns?.readOnly}">
			        	<input type="text" id="vBgs" name="vBgs" class="layui-input" readonly/>
		        	</td>
			        <td class="table-title">入职时间</td>
			        <td colspan="2"><input type="text" id="dRzRq" name="dRzRq" autocomplete="off" readonly class="layui-input" placeholder="请选择时间"/></td>
			      </tr> -->
		    	  <tr>
			        <td class="table-title">姓名</td>
			        <td><input type="text" id="userName" name="userName" autocomplete="off" class="layui-input"></td>
			        <td class="table-title">性别</td>
			        <td>
			        	<input type="radio" name="userSex" value="男" title="男">
      					<input type="radio" name="userSex" value="女" title="女">
		        	</td>
			        <td class="table-title">出生年月</td>
			        <td><input type="text" id="dCsRq" name="dCsRq" autocomplete="off" readonly class="layui-input" placeholder="请选择时间"/></td>
			        <td th:if="${!gridColumns?.readOnly}" rowspan="4" width="100px;" style="text-align: center;cursor: pointer;" onclick="avatar()" class="userPhoto">
			        	上传免冠照片
		        	</td>
		        	<td th:if="${gridColumns?.readOnly}" rowspan="4" width="100px;" style="text-align: center;cursor: pointer;" class="userPhoto">
			        	上传免冠照片
		        	</td>
		        	<input type="hidden" id="userPhoto" name="userPhoto">
			      </tr>
		    	  <tr>
			        <td class="table-title">婚姻情况</td>
			        <td>
			        	<input type="radio" name="vHyQk" value="已婚" title="已婚">
			        	<input type="radio" name="vHyQk" value="未婚" title="未婚">
		        	</td>
			        <td class="table-title">籍贯</td>
			        <td th:if="${!gridColumns?.readOnly}">
			        	<div class="layui-input-inline date-box" style="width:100px;height:20px">
				        	<select name="userProvince" id="userProvince" lay-filter="userProvince" th:with="type=${@baseinfosimple.getBaseInfoSimpleData('area2')}">
				        		<option></option>
								<option th:each="dict : ${type}" th:text="${dict.vname}" th:data-guid="${dict.guid}" th:value="${dict.vid}" ></option>
					      	</select>
				      	</div>省
				      	<div class="layui-input-inline date-box" style="width:100px;height:20px">
				      		<select name="userCity" id="userCity"></select>
			      		</div>市
			        </td>
			        <td th:if="${gridColumns?.readOnly}">
			        	<div class="layui-input-inline date-box" style="width:100px;height:20px">
				        	<input type="text" id="userProvince" name="userProvince" autocomplete="off" class="layui-input">
				      	</div>省
				      	<div class="layui-input-inline date-box" style="width:100px;height:20px">
				      		<input type="text" id="userCity" name="userCity" autocomplete="off" class="layui-input">
			      		</div>市
			        </td>
			        <td class="table-title">政治面貌</td>
			        <td th:if="${!gridColumns?.readOnly}">
			        	<select name="vZzMm" id="vZzMm">
			        		<option></option>
							<option value="群众">群众</option>
							<option value="团员">团员</option>
							<option value="预备党员">预备党员</option>
							<option value="党员">党员</option>
				      	</select>
			        </td>
			        <td th:if="${gridColumns?.readOnly}"><input type="text" id="vZzMm" name="vZzMm" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td class="table-title">毕业院校</td>
			        <td><input type="text" id="vByYx" name="vByYx" autocomplete="off" class="layui-input"></td>
			        <td class="table-title">专业</td>
			        <td><input type="text" id="vZy" name="vZy" autocomplete="off" class="layui-input"></td>
			        <td class="table-title">学历</td>
			        <td th:if="${!gridColumns?.readOnly}">
			        	<select name="vXl" id="vXl" th:with="type=${@baseinfosimple.getBaseInfoSimpleData('jyxl')}">
			        		<option></option>
							<option th:each="dict : ${type}" th:text="${dict.vname}" th:data-guid="${dict.guid}" th:value="${dict.vid}"></option>
			      		</select>
			        </td>
			        <td th:if="${gridColumns?.readOnly}"><input type="text" id="vXl" name="vXl" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td class="table-title">身份证号码</td>
			        <td><input type="text" id="vSfzHm" name="vSfzHm" autocomplete="off" class="layui-input"></td>
			        <td class="table-title">电子邮箱</td>
			        <td><input type="text" id="userMail" name="userMail" autocomplete="off" class="layui-input"/></td>
			        <td class="table-title">手机号码</td>
			        <td><input type="text" id="userPhone1" name="userPhone1" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td class="table-title">户口性质</td>
			        <td>
			        	<input type="radio" name="vHkXz" value="农村" title="农村" checked>
			        	<input type="radio" name="vHkXz" value="城镇" title="城镇">
		        	</td>
		        	<!-- 
			        <td class="table-title">计划转正日期</td>
			        <td><input type="text" id="dJhZzRq" name="dJhZzRq" autocomplete="off" readonly class="layui-input" placeholder="请选择时间"/></td>
			         -->
			        <td class="table-title"></td>
			        <td class="table-title"></td>
			        <td class="table-title">毕业年份</td>
			        <td><input type="text" id="vByNf" name="vByNf" autocomplete="off" readonly class="layui-input" placeholder="请选择时间"/></td>
			      </tr>
		    	  <tr>
			        <td class="table-title">户籍地址</td>
			        <td colspan="3"><input type="text" id="vHjDz" name="vHjDz" autocomplete="off" class="layui-input" placeholder="请输入身份证正面住址"></td>
			        <td class="table-title">计算机等级</td>
			        <td colspan="2"><input type="text" id="vZcZs" name="vZcZs" autocomplete="off" class="layui-input" placeholder="请输入计算机等级"></td>
			      </tr>
		    	  <tr>
			        <td class="table-title">现居地址</td>
			        <td colspan="3"><input type="text" id="vJtZz" name="vJtZz" autocomplete="off" class="layui-input" placeholder="请输入现居住地址"></td>
			        <td class="table-title">外语等级</td>
			        <td colspan="2"><input type="text" id="vWyZs" name="vWyZs" autocomplete="off" class="layui-input" placeholder="请输入外语等级"></td>
			      </tr>
				  <tr>
			        <td class="table-title">自我评价</td>
			        <td colspan="3"><input type="text" id="vZwPj" name="vZwPj" autocomplete="off" class="layui-input" placeholder="请输入自我评价"></td>
			        <td class="table-title">其他证书</td>
			        <td colspan="2"><input type="text" id="vWyZsQt" name="vWyZsQt" autocomplete="off" class="layui-input" placeholder="请输入其他证书"></td>
			      </tr>
		    	  <tr>
			        <td class="table-title" rowspan="4" style="width: 200px;">学校荣誉</td>
			        <td class="table-title">获得时间</td>
			        <td class="table-title" colspan="2">学校</td>
			        <td class="table-title">职位/荣誉</td>
			        <td class="table-title" colspan="2">具体内容</td>
			        <!-- <td class="table-title">就学形式</td> -->
			      </tr>
		    	  <tr>
		    	  	<td>
		    	  		<div class="layui-input-inline date-box">
		    	  			<input type="text" autocomplete="off" readonly id="dRxSj0" class="layui-input dRxSj0" placeholder="请选择开始日期"/>
	    	  			</div>~
			      		<div class="layui-input-inline date-box">
			      			<input type="text" autocomplete="off" readonly id="dBySj0" class="layui-input dBySj0" placeholder="请选择截止日期"/>
		      			</div>
	    	  		</td>
			        <td colspan="2"><input type="text" id="vXx0" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="vXl0" autocomplete="off" class="layui-input"></td>
			        <td colspan="2"><input type="text" id="vZy0" autocomplete="off" class="layui-input"></td>
			        <!-- <td th:if="${!gridColumns?.readOnly}">
			        	<select id="vJxXs0" th:with="type=${@baseinfosimple.getBaseInfoSimpleData('jxxs')}">
			        		<option></option>
							<option th:each="dict : ${type}" th:text="${dict.vname}" th:value="${dict.vname}"></option>
			      		</select>
		      		</td>
		      		<td  th:if="${gridColumns?.readOnly}">
			        	<input type="text" id="vJxXs0" autocomplete="off" class="layui-input">
		      		</td> -->
			      </tr>
		    	  <tr>
		    	  	<td>
						<div class="layui-input-inline date-box">
		    	  			<input type="text" autocomplete="off" readonly id="dRxSj1" class="layui-input" placeholder="请选择入学日期"/>
	    	  			</div>~
			      		<div class="layui-input-inline date-box">
			      			<input type="text" autocomplete="off" readonly id="dBySj1" class="layui-input" placeholder="请选择毕业日期"/>
		      			</div>
					</td>
			        <td colspan="2"><input type="text" id="vXx1" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="vXl1" autocomplete="off" class="layui-input"></td>
			        <td colspan="2"><input type="text" id="vZy1" autocomplete="off" class="layui-input"></td>
			        <!-- <td th:if="${!gridColumns?.readOnly}">
			        	<select id="vJxXs1" th:with="type=${@baseinfosimple.getBaseInfoSimpleData('jxxs')}">
			        		<option></option>
							<option th:each="dict : ${type}" th:text="${dict.vname}" th:value="${dict.vname}"></option>
			      		</select>
		      		</td>
		      		<td th:if="${gridColumns?.readOnly}">
			        	<input type="text" id="vJxXs1" autocomplete="off" class="layui-input">
		      		</td> -->
			      </tr>
		    	  <tr>
		    	  	<td>
						<div class="layui-input-inline date-box">
		    	  			<input type="text" autocomplete="off" readonly id="dRxSj2" class="layui-input" placeholder="请选择入学日期"/>
	    	  			</div>~
			      		<div class="layui-input-inline date-box">
			      			<input type="text" autocomplete="off" readonly id="dBySj2" class="layui-input" placeholder="请选择毕业日期"/>
		      			</div>
					</td>
			        <td colspan="2"><input type="text" id="vXx2" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="vXl2" autocomplete="off" class="layui-input"></td>
			        <td colspan="2"><input type="text" id="vZy2" autocomplete="off" class="layui-input"></td>
			        <!-- <td th:if="${!gridColumns?.readOnly}">
			        	<select id="vJxXs2" th:with="type=${@baseinfosimple.getBaseInfoSimpleData('jxxs')}">
			        		<option></option>
							<option th:each="dict : ${type}" th:text="${dict.vname}" th:value="${dict.vname}"></option>
			      		</select>
		      		</td>
		      		<td th:if="${gridColumns?.readOnly}">
			        	<input type="text" id="vJxXs2" autocomplete="off" class="layui-input">
		      		</td> -->
			      </tr>
		    	  <tr>
			        <td class="table-title" rowspan="4">工作履历</td>
			        <td class="table-title">工作时间</td>
			        <td class="table-title">职务</td>
			        <td class="table-title">所在单位</td>
			        <td class="table-title">离职原因</td>
			        <td class="table-title" colspan="2">主要工作业绩</td>
			      </tr>
		    	  <tr>
			        <td>
			        	<div class="layui-input-inline date-box">
		    	  			<input type="text" autocomplete="off" readonly id="dRzSj0" class="layui-input" placeholder="请选择入职日期"/>
	    	  			</div>~
			      		<div class="layui-input-inline date-box">
			      			<input type="text" autocomplete="off" readonly id="dLzSj0" class="layui-input" placeholder="请选择离职日期"/>
		      			</div>
			        </td>
			        <td><input type="text" id="vZw0" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="vDw0" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="vLzYy0" autocomplete="off" class="layui-input"></td>
			        <td colspan="2"><input type="text" id="vGzYj0" autocomplete="off" class="layui-input"></td>
			      </tr>
			      <tr>
			        <td>
			        	<div class="layui-input-inline date-box">
		    	  			<input type="text" autocomplete="off" readonly id="dRzSj1" class="layui-input" placeholder="请选择入职日期"/>
	    	  			</div>~
			      		<div class="layui-input-inline date-box">
			      			<input type="text" autocomplete="off" readonly id="dLzSj1" class="layui-input" placeholder="请选择离职日期"/>
		      			</div>
	      			</td>
			        <td><input type="text" id="vZw1" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="vDw1" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="vLzYy1" autocomplete="off" class="layui-input"></td>
			        <td colspan="2"><input type="text" id="vGzYj1" autocomplete="off" class="layui-input"></td>
			      </tr>
			      <tr>
			        <td>
			        	<div class="layui-input-inline date-box">
		    	  			<input type="text" autocomplete="off" readonly id="dRzSj2" class="layui-input" placeholder="请选择入职日期"/>
	    	  			</div>~
			      		<div class="layui-input-inline date-box">
			      			<input type="text" autocomplete="off" readonly id="dLzSj2" class="layui-input" placeholder="请选择离职日期"/>
		      			</div>
	      			</td>
			        <td><input type="text" id="vZw2" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="vDw2" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="vLzYy2" autocomplete="off" class="layui-input"></td>
			        <td colspan="2"><input type="text" id="vGzYj2" autocomplete="off" class="layui-input"></td>
			      </tr>

		    	  <tr>
			        <td class="table-title" rowspan="2">有无子女</td>
			        <td rowspan="2">
			        	<input type="radio" name="vYwZn" value="无" title="无">
			        	<input type="radio" name="vYwZn" value="有" title="有" checked>
		        	</td>
			        <td class="table-title" colspan="2">子女1出生年月</td>
			        <td colspan="3">
			        	<input type="text" id="dZnCsRq1" name="dZnCsRq1" autocomplete="off" readonly class="layui-input" placeholder="请选择时间"/>
		        	</td>
			      </tr>
			      <tr>
			        <td class="table-title" colspan="2">子女2出生年月</td>
			        <td colspan="3">
			        	<input type="text" id="dZnCsRq2" name="dZnCsRq2" autocomplete="off" readonly class="layui-input" placeholder="请选择时间"/>
		        	</td>
			      </tr>

		    	  <tr>
			        <td class="table-title">紧急联系人</td>
			        <td><input type="text" id="vLxrXm" name="vLxrXm" autocomplete="off" class="layui-input"></td>
			        <td class="table-title">关系</td>
			        <td><input type="text" id="vLxrGx" name="vLxrGx" autocomplete="off" class="layui-input"></td>
			        <td class="table-title">联系电话</td>
			        <td colspan="2"><input type="text" id="vLxrDh" name="vLxrDh" autocomplete="off" class="layui-input"></td>
			      </tr>

				  <tr>
			        <th colspan="7" style="background-color: #99cffd;height: 30px;">求职意向</th>
			      </tr> 
				  <tr>
			        <td class="table-title">求职岗位</td>
					<td colspan="1" th:if="${!gridColumns.readOnly}">
						<input type="text" id="vGw" name="vGw" autocomplete="off" class="layui-input" lay-verify="required"/>
						<i class="layui-icon layui-icon-more getMore" style="position:absolute" onclick="getMore('vGw',null,'岗位','ts_roleinfo');"></i>
					</td>
					<td colspan="1" th:if="${gridColumns?.readOnly}">
						<input type="text" id="vGw" name="vGw" class="layui-input" lay-verify="required" readonly/>
					</td>
					<td class="table-title">意向城市</td>
					<td><input type="text" id="vYxCs" name="vYxCs" autocomplete="off" class="layui-input"></td>
			        <td class="table-title">所属办公室</td>
					<td colspan="2" th:if="${!gridColumns.readOnly}">
						<input type="text" id="vBgs" name="vBgs" autocomplete="off" class="layui-input" lay-verify="required"/>
						<i class="layui-icon layui-icon-more getMore" style="position:absolute" onclick="getMore('vBgs',null,'办公室','tb_baseinfo_bgs');"></i>
					</td>
					<td colspan="2" th:if="${gridColumns?.readOnly}">
						<input type="text" id="vBgs" name="vBgs" class="layui-input" readonly/>
					</td>
					
			      </tr>
				  <tr>
			        
			        <td class="table-title">期望薪资</td>
					<td><input type="text" id="vQwXz" name="vQwXz" autocomplete="off" class="layui-input"></td>
			        <td class="table-title">计划入职时间</td>
					<td><input type="text" id="dRzRq" name="dRzRq" autocomplete="off" readonly class="layui-input" placeholder="请选择时间"/></td>
					<td colspan="3"></td>
			      </tr>

			      </tbody>
				  <!-- <thead>
			      	<tr>
			        	<th colspan="7">以下内容请下载后填写</th>
			      	</tr> 
			      </thead>
			      <tbody>
		    	  <tr>
			        <td>招聘来源信息</td>
			        <td colspan="6"><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td>有无亲友在本公司（必填）</td>
			        <td><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			        <td>与其他单位有无劳动关系</td>
			        <td><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			        <td>能否出差</td>
			        <td>上班交通</td>
			        <td><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td rowspan="4">家庭成员</td>
			        <td>称呼</td>
			        <td>姓名</td>
			        <td colspan="2">工作单位</td>
			        <td>职务</td>
			        <td>联系电话</td>
			      </tr>
		    	  <tr>
			        <td>父亲</td>
			        <td><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			        <td colspan="2"><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td>母亲</td>
			        <td><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			        <td colspan="2"><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td>配偶</td>
			        <td><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			        <td colspan="2"><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			      </tr>
		    	  <tr>
			        <td colspan="7">请列举能提供有关填表人品性、待人处世及工作能力资料的直属主管/单位人事/公司领导三个证明人。（必填）</td>
			      </tr>
		    	  <tr>
			        <td>姓名</td>
			        <td>关系</td>
			        <td colspan="2">服务单位</td>
			        <td>现任职务</td>
			        <td colspan="2">地址/联系电话</td>
			      </tr>
			      <tr>
			        <td><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			        <td colspan="2"><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			        <td><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			        <td colspan="2"><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			      </tr>
			      <tr>
			        <td>健康状况（请如实填写）：</td>
			        <td colspan="6"><input type="text" id="" name="" autocomplete="off" class="layui-input"></td>
			      </tr>
			      <tr>
			        <td colspan="7">本人承诺：我谨此声明本表信息全部属实,并且愿意接受公司的查证,如经查证不符,公司有权给予解雇,一切后果由本人自负。本表中黑色加粗有底纹的信息如有变更将在1周内书面通知公司,现居住地址为本人文书有效送达地址。签名：            </td>
			      </tr>
			      </tbody> -->
			  </table>
		  	</div>
    	</div>
	   	<th:block th:include="include :: pageFooter" /> 
        </form>
	</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: businessJS" />
<th:block th:include="include :: businessTableBtn" />
<th:block th:include="include :: inlineJS" />
<script type="text/javascript">
var $,layer,form,laydate,element;//定义layui模块
var nid = $("#nid").val(),noTable;//定义全局参数
var cItems=['jyjl','gzjl'];//子表集合
var fItems=[
	['dRxSj','dBySj','vJxXs','vXl','vXx','vZy'],['dRzSj','dLzSj','vDw','vGzYj','vLzYy','vZw']
	];//子表字段集合
layui.use(['laydate','form','layer','jquery','util','element'], function () {
 	$ = layui.$,layer = layui.layer,form = layui.form,laydate = layui.laydate,util = layui.util,element=layui.element;
 	beforeInit();//表单初始化之前的动作集合
 	if(!gridColumns.readOnly){
		$.each(t_fields, function(i,v){
			if(v.fieldFrontRequired){
				if(['userProvince','userCity'].includes(v.fields)){
					$("#"+v.fields).parent().parent().prev().html('<font class="f_red">*</font>籍贯');
				}else if(['userSex','vHyQk','vHkXz','vYwZn','vZpXxLy','vQy','vCc','vSbJt','vQtDw'].includes(v.fields)){
					$("[name="+v.fields+"]").parent().prev().prepend('<font class="f_red">*</font>');
				}else if(v.fields == 'bSfzCqYx'){
					$("#bSfzCqYx_box").parent().prev().prepend('<font class="f_red">*</font>');
				}else $("#"+v.fields).parent().prev().prepend('<font class="f_red">*</font>');
			}
		})
 		laydate.render({elem:'#vByNf',type:'year',trigger:'click'});
 	 	laydate.render({elem:'#dRzRq',trigger:'click'});
 	 	laydate.render({elem:'#dCsRq',trigger:'click'});
 	 	laydate.render({elem:'#dSfzYxq',trigger:'click'});
 	 	laydate.render({elem:'#dJhZzRq',trigger:'click'});
 	 	laydate.render({elem:'#dZnCsRq1',trigger:'click'});
 	 	laydate.render({elem:'#dZnCsRq2',trigger:'click'});
 	 	laydate.render({elem:'#dRxSj0',trigger:'click'});
 	 	laydate.render({elem:'#dBySj0',trigger:'click'});
 	 	laydate.render({elem:'#dRxSj1',trigger:'click'});
 	 	laydate.render({elem:'#dBySj1',trigger:'click'});
 	 	laydate.render({elem:'#dRxSj2',trigger:'click'});
 	 	laydate.render({elem:'#dBySj2',trigger:'click'});
 	 	laydate.render({elem:'#dRzSj0',trigger:'click'});
 	 	laydate.render({elem:'#dLzSj0',trigger:'click'});
 	 	laydate.render({elem:'#dRzSj1',trigger:'click'});
 	 	laydate.render({elem:'#dLzSj1',trigger:'click'});
 	 	laydate.render({elem:'#dRzSj2',trigger:'click'});
 	 	laydate.render({elem:'#dLzSj2',trigger:'click'});
 	}
 	layui.element.render();
 	$.get("/hr/personnelrzxx/listbynid?nid="+nid,function(res){
 		noTable=res.data[0];//[主表,'jyjl','gzjl']
 		if(nid){//不是新单据的情况
 			$.each(t_fields,function(v,k){//主表赋值
 				if((k.fields=="userSex"||k.fields=="vHyQk"||k.fields=="vZcZs"||k.fields=="vHkXz"||k.fields=="vYwZn") && k.fieldContent){
 		 			$("input[name="+k.fields+"][value="+k.fieldContent+"]").attr("checked",true);
 		 			if(gridColumns.readOnly)$("input[name="+k.fields+"]").attr('disabled','disabled');
 		 		}else $('#'+k.fields).val(k.fieldContent);
 				if(k.fields=="vZcZs" && k.fieldContent!='无' && k.fieldContent!='有')$('#'+k.fields).val(k.fieldContent);
 				if(k.fields=="userPhoto" && k.fieldContent)$(".userPhoto").html('<img title="点击更换" src="'+k.fieldContent+'">');
 				if(k.fields=='userCity')getCity($('#userProvince').find("option:selected").attr('data-guid'),k.fieldContent);
 		 	})
 		 	$.each(cItems,function(v,k){//初始赋值——子表
 				$.each(res.data[v+1],function(v1,k1){
 					$.each(k1,function(v2,k2){
 						$('#'+v2+v1).val(k2);
 					})
 				})
 			})
 		 	form.render();
 		}
	});
 	if(gridColumns.readOnly){//流程结束后静态表格变为不可编辑
 	 	$('table input').attr('readonly','readonly');
		$('table .canntEdit').removeClass('canntEdit');
 	}
 	$('#vZcZs').blur(function(){//证书职称单选框与复选框共用一个字段
 		$("input[name=vZcZs]").last().click();
 		$("input[name=vZcZs]").last().val($('#vZcZs').val());
 	 	form.render();
 	})
	form.on('select(userProvince)', function(data){//监听省份选择
    	var pguid = data.elem[data.elem.selectedIndex].dataset.guid;
    	getCity(pguid);//联动获取城市列表
	})
})
function avatar(){//用户头像
    var url = '/hr/personnelrzxx/avatar?nid='+nid;
    $.modal.open('上传照片',url,'800','600',function(index){
        var res = window["layui-layer-iframe" + index].updateAvatar();
        $("#userPhoto").val(res.data.filePath);
        $(".userPhoto").html('<img title="点击更换" src="'+res.data.filePath+'">');
        layer.close(index);
        layer.msg(res.msg);
    });
}
function getCity(pguid,cityname){//省市联动
	$.ajax({
		url: '/base/baseinfo/list?pguid='+pguid,
        type: 'get',
        dataType: 'json',
        success: function(result) {
        	var areaList = '<option></option>';
        	$.each(result.data,function(k,v){
        		if(cityname == v.vname)areaList += '<option value="'+v.vname+'" selected>'+v.vname+'</option>';
        		else areaList += '<option value="'+v.vname+'">'+v.vname+'</option>';
        	});
        	$("#userCity").empty();//先清空原有下拉选项
        	$("#userCity").append(areaList);
        	form.render('select');
        }
	})
}
function beforeSave(tableData){//保存之前的动作集
	$.each(fItems,function(v,k){//循环子表字段数组
		tableData[0][cItems[v]+'Items']=[];//定义数组对象
		if(cItems[v]=='jyjl'){//教育经历
			tableData[0][cItems[v]+'Items'][0]={};//定义对象
			tableData[0][cItems[v]+'Items'][1]={};//定义对象
			tableData[0][cItems[v]+'Items'][2]={};//定义对象
			for(j of [0,1,2]){//循环三次
				tableData[0][cItems[v]+'Items'][j]['iid']=j;
				for(i of k){
					tableData[0][cItems[v]+'Items'][j][i]=$('#'+i+j).val();
				}
			}
		}
		if(cItems[v]=='gzjl'){//工作经历
			tableData[0][cItems[v]+'Items'][0]={};//定义对象
			tableData[0][cItems[v]+'Items'][1]={};//定义对象
			tableData[0][cItems[v]+'Items'][2]={};//定义对象
			for(j of [0,1,2]){//循环三次
				tableData[0][cItems[v]+'Items'][j]['iid']=j;
				for(i of k){
					tableData[0][cItems[v]+'Items'][j][i]=$('#'+i+j).val();
				}
			}
		}
	})
	return tableData;
}
</script>
</body>
</html>